<%= header %>
<%= boomerangScript %>

<script src="../../vendor/jquery/dist/jquery.min.js"></script>
<script src="../../vendor/ember/ember.debug.js"></script>
<script src="../../vendor/handlebars/handlebars.min.js"></script>
<script src="../../vendor/ember/ember-template-compiler.js"></script>
<script src="support/app.js"></script>

<script type="text/x-handlebars">
	<div class="container">
		{{outlet}}
	</div>
</script>

<script src="/test-templates/spa/09-autoxhr-after-load.js" type="text/javascript"></script>
<script src="09-autoxhr-after-load.js"></script>

<script>
var xhr;

var beaconNum = 0;
BOOMR.subscribe("beacon", function() {
	if (!BOOMR.plugins.AutoXHR) {
		return;
	}

	setTimeout(function() {
		if (beaconNum === 0) {
			// first XHR
			xhr = new XMLHttpRequest();
			xhr.open("GET", "/delay?delay=3000&file=/pages/08-ember/support/widgets.json&id=1&rnd=" + Math.random(), true);
			xhr.send(null);
		}
		else if (beaconNum === 1) {
			xhr = new XMLHttpRequest();
			xhr.open("GET", "/delay?delay=1000&file=/pages/08-ember/support/widgets.json&id=2&rnd=" + Math.random(), true);
			xhr.send(null);
		}
		beaconNum++;
	}, 100);
});

BOOMR_test.init({
	testAfterOnBeacon: BOOMR.plugins.AutoXHR ? 3 : 1,
	History: {
		enabled: true,
		monitorHistory: false
	},
	instrument_xhr: true,
	autorun: false
});
</script>
<%= footer %>
